import request from '@/router/axios'

export function queryGoodsList(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}
export function queryShangPinLeiMu(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}
export function queryShangPinFenLei(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}
export function publishGood(url, query) {
  return request({
    url: url,
    method: 'post',
    data: query
  })
}
export function getGoodDetail(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}
export function goodsTypeTree(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}
export function getInfo(query) {
  return request({
    url: '/app/dict/info',
    method: 'get',
    params: query
  })
}
export function getShenHe(query) {
  return request({
    url: '/app/operateGoods/approvalGoods',
    method: 'post',
    data: query
  })
}
export function getUnderRange(url, query) {
  return request({
    url: url,
    method: 'post',
    data: query
  })
}
export function getBannerList(query) {
  return request({
    url: '/app/dict/banner_type',
    method: 'get',
    params: query
  })
}
export function fanhallBanner(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}
export function addPicture(url, query) {
  return request({
    url: url,
    method: 'post',
    data: query
  })
}
export function deleteGood(url, query) {
  return request({
    url: url,
    method: 'post',
    data: query
  })
}

// 查询字典列表
export function queryDictList(word) {
  return request({
    url: '/app/dict/' + word,
    method: 'get'
  })
}

// 商家发布商品到pc
export function sellerPublishGoodsPc(bool, query) {
  const str = bool ? '/app/operateGoods/platformSave' : '/app/operateGoods/save'
  // const str = '/app/operateGoods/save'
  return request({
    url: str,
    method: 'post',
    data: query
  })
}

// 设计师发布设计稿到平台
export function designerPublishGoodsPc(query) {
  return request({
    url: '/app/operateGoods/publishDesign',
    method: 'post',
    data: query
  })
}

// 查询适用人群列表
export function querySuitPeople() {
  return request({
    url: '/app/mall/categoryMenu/getCategory',
    method: 'get'
  })
}

// 获取对应款式
export function querySuitPeopleKind(val) {
  return request({
    url: '/app/mall/categoryMenu/getTypeByCategory/' + val,
    method: 'get'
  })
}

// 查询风格列表
export function queryStyleList() {
  return request({
    url: '/app/mall/categoryMenu/getFeature',
    method: 'get'
  })
}

// 获取商品详情
export function queryGoodsDetail(val) {
  return request({
    url: '/app/operateGoods/' + val,
    method: 'get'
  })
}

// 品牌商完善企业信息
export function brandCompleteInformation(url, query) {
  return request({
    url: url,
    method: 'post',
    data: query
  })
}

// 获取活动列表
export function getActivityList(query) {
  return request({
    url: '/app/yykGoodsActivity/page',
    method: 'get',
    params: query
  })
}

// 新增活动
export function addActivity(query) {
  return request({
    url: '/app/yykGoodsActivity/add',
    method: 'post',
    data: query
  })
}

// 删除活动
export function deleteActivity(id) {
  return request({
    url: '/app/yykGoodsActivity/delete/' + id,
    method: 'get'
  })
}

